import request from "@/utils/request";
const FINANCE_BASE_URL = "/api";

const FinanceAPI = {
  getPage(queryParams: financePageQuery) {
    return request<any, PageResult<[]>>({
      url: `${FINANCE_BASE_URL}/supplier/account/`,
      method: "get",
      params: queryParams,
    });
  },
  getWithdrawnLog(queryParams) {
    return request<any, PageResult<[]>>({
      url: `${FINANCE_BASE_URL}/supplier/withdrawn/`,
      method: "get",
      params: queryParams,
    });
  },
  addWithdrawn(queryParams) {
    return request<any, PageResult<[]>>({
      url: `${FINANCE_BASE_URL}/supplier/withdrawn/`,
      method: "post",
      data: queryParams,
    });
  },
  getAccountBank() {
    return request<any, PageResult<[]>>({
      url: `${FINANCE_BASE_URL}/account/bank/`,
      method: "get",
    });
  },
  addAccountBank(data) {
    return request<any, PageResult<[]>>({
      url: `${FINANCE_BASE_URL}/account/bank/`,
      method: "post",
      data: data
    });
  },
}

export default FinanceAPI;

export interface financePageQuery {
  status?: string; //freeze冻结，normal正常
  search?: string;
  page?: number;
  size?: number;
}

